//
// Copyright (c) 2014, yksoft1 <yksoft1@tom.com>.
// All rights reserved.
//
// This file is part of SDLPAL95r.
//
// SDLPAL95r is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
#include "common.h"
#include "palcommon.h"
#include "text.h"
#include "cheat.h"
/*
Cheats.
0: Walks like Akai Suisei Char.
1: Physical attacks kill enemy in one hit.
2: Single-target physical attacks and magic attacks attack enemy party.
3: Every attack hit is a critical hit.
4: Physical attacks repeat for 12 times.
5: 100% escape rate on non-bosses.
6: Infinite throws.
7: 100% steal rate.
8: Enemies can't move at all.
9: Not implemented.
*/
#define CHEAT_MAX 8
int Cheat[10];

void initCheat()
{
	int i;
	for(i=0;i<10;i++)
	Cheat[i]=0;
}

void ToggleCheat(int i)
{
	char tc[18];
	if(i<0||i>CHEAT_MAX) return;
	Cheat[i]=!Cheat[i];
	sprintf(tc,Cheat[i]?"Enabled cheat %d":"Disabled cheat %d",i);
    PAL_StartDialog(kDialogCenterWindow, 0, 0, FALSE);
	PAL_ShowDialogText(tc);
}

int GetCheat(int i)
{
	if(i<0||i>CHEAT_MAX) return 0;
	return Cheat[i];
}